<?php 
//更新统计心愿分类缓存
$arrTypess = $db->fetch_all_assoc("select * from ".dbprefix."wish_type");
foreach($arrTypess as $key=>$item){
	$wish = $db->once_fetch_assoc("select count(wishid) from ".dbprefix."wish where typeid='".$item['typeid']."'");
	$arrTypes['list'][] = array(
		'typeid'	=> $item['typeid'],
		'typename'	=> $item['typename'],
		'count_wish'	=> $wish['count(wishid)'],
	);
}

$wishNum = $db->once_fetch_assoc("select count(wishid) from ".dbprefix."wish");
$arrTypes['count'] = $wishNum['count(wishid)'];

//生成缓存文件
fileWrite('wish_types.php','data',$arrTypes);

qiMsg("更新成功！");